package lib.pacificapp.datahub.impl;

import org.json.JSONArray;
import org.json.JSONObject;

import android.content.Context;
import android.util.Log;

public class BaseData {
	 /***获取测试数据*/
	   protected String getDataByResourceId(Context context,int resourceId){
		   return context.getResources().getString(resourceId);
		   
	   }
	   protected JSONObject getJSONObjectByResourceId(Context context,int resourceId){
		    JSONObject data=null;
			try {
				  data=new JSONObject(getDataByResourceId(context,resourceId));
			} catch (Exception e) {
				  e.printStackTrace();
			} 
			return data;
	   }
	   protected JSONArray getJSONArrayByResourceId(Context context,int resourceId){
		   JSONArray data=null;
			try {
				  data=new JSONArray(getDataByResourceId(context,resourceId));
			} catch (Exception e) {
				  e.printStackTrace();
			} 
			return data;
	   }
}
